<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>客服列表</title>

<link rel="stylesheet" href="/layui/css/layui.css">
<link rel="stylesheet" href="/hyqcss/public.css">
<link rel="stylesheet" href="/fission/css/iconfont.css">
<link rel="stylesheet" href="/fission/css/common.css">
<script src="/cdn/echarts.min.js"></script>
<style type="text/css">
	body{
		background: #e9e9e9;
	}
	/*公共头部带搜索*/
	.public_container{
		margin: 20px;
		background: #fff;
	}
	.public_buttonSearch_container{
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 20px;
		background: #fff;
	}
	.public_buttonSearch_container a{
		color: #fff;
		background-color: #1E9FFF;
		text-shadow: 0 -1px 0 rgba(0,0,0,.12);
		height: 24px;
		padding: 4px 15px;
		font-size: 14px;
		border-radius: 2px;
		display: flex;
		align-items: center;
	}
</style>
</head>
<body>
<div class="public_container">
	<div class="qrcode_table_container" style="display: block;">
		<div class="public_buttonSearch_container">
			<a href="welcome.html">+ 新建欢迎语</a>
		</div>
		<div class="public_table_container layui-form">
			<table class="layui-table" lay-skin="line"> 
			    <thead>
			      <tr>
			        <th>欢迎语类型</th>
			        <th>创建时间	</th>
			        <th>使用账号</th>
			        <th>排序</th>
			        <th>操作</th>
			      </tr> 
			    </thead>
			    <tbody>
			      {loop $welcome_list as $welcome}
				  <tr>
					<td>{$type[$welcome['other_type']]}</td>
					<td>{$welcome['ctime']}</td>
					<td>{if $welcome['type'] == 1}
							<div class="service-card">
				    	    	<!-- <i class="iconfont icon-person"></i> -->通用
					        </div>
						{else}
						{loop json_decode($welcome['users'],1) as $userid}
				        	<div class="service-card">
				        		<i class="iconfont icon-person"></i>{$this->get_user_name($userid)}
					        </div>
				      	{/loop}
					{/if}</td>
					<td>
						<input type="text" name="order" lay-verify="title" onblur="check({$welcome['id']})"  id="{$welcome['id']}"autocomplete="off" value="{$welcome['orders']}" class="layui-input" style="width: 100px;">
					</td>
					<td>
						<a class="table-public-btn" href="welcome-{$welcome['id']}.html">编辑</a>
						<a class="table-public-btn" onclick="del_welcome({$welcome['id']})">删除</a>
					</td>
				  </tr>
				{/loop}
			    </tbody>
			</table>
		</div> 
		<!-- 公共表格部分 end-->
		<div class="main-container-h pageing-container-h">
        <div class="pageing-content-h">
            <span>{$p->totalnum}条/{$p->totalpage}页</span>
        </div>
      	<ul class="pageing-content-h">{P weidogsadmin}</ul>
     	</div>
	</div>
	
</div>
<script src="/cdn/jquery.js"></script>
<script src="/layui/layui.js"></script>
<script src="/js/ajax.js"></script>
<script type="text/javascript">
	function del_welcome(id){
		myAjaxPost(false, true, 'del_welcome.html',{ id:id}, function (resp) {
			if (resp.status == 'success') {
				tusi(resp.msg);
				setTimeout(function(){ 
					location.reload(); 
				},2000);
			}else{
				tusi(resp.msg);
			}
		})
	}

	function check(id){
		myAjaxPost(false, true, 'welcome_order.html',{ id:id,counts:$("#"+id).val()}, function (resp) {
			tusi(resp.msg);
		})
	}
</script>
</body>
</html>